package com.yrihr.wisdom.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName : River
 * @Description : 河道水情 采用分表不分库
 * @Author : wind
 * @Date: 2020-12-16 16:17
 * @Version 1.0
 */
@Data
@TableName("river")
public class River implements Serializable {
    private static final long serialVersionUID = 8177959686072100253L;
    @ExcelIgnore
    private Long id;

    /**
     * 区间 interval 主键
     */
    @ExcelIgnore
    private long intervalId;

    @ColumnWidth(13)
    @ExcelProperty(value = "区间")
    private String intervalName;

    /**
     * 河道名 伊洛河
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "河道名")
    private String riverName;

    /**
     * 站名 黑石关
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "站名")
    private String siteName;

    /**
     * 站点编号
     */
    @ColumnWidth(15)
    @ExcelProperty(value = "站点编号")
    private Long siteId;

    /**
     * 时间
     */
    @ColumnWidth(28)
    @ExcelProperty(value = "时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date time;

    /**
     * 水位 107.86
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "水位")
    private double waterLevel;

    /**
     * 水势 平
     */
    @ColumnWidth(8)
    @ExcelProperty(value = "水势")
    private String waterPotential;

    /**
     * 流量 24
     */
    @ColumnWidth(10)
    @ExcelProperty(value = "流量")
    private double flow;

    /**
     * 更新时间 2019-07-18 06:00
     */
    @ExcelIgnore
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    /**
     * 创建时间 2019-07-18 06:00
     */
    @ExcelIgnore
    private Date createTime;

    public River() {
    }

    public River(Long id, long intervalId, String riverName, String siteName, Long siteId, Date time, double waterLevel, String waterPotential, double flow) {
        this.id = id;
        this.intervalId = intervalId;
        this.riverName = riverName;
        this.siteName = siteName;
        this.siteId = siteId;
        this.time = time;
        this.waterLevel = waterLevel;
        this.waterPotential = waterPotential;
        this.flow = flow;
    }

    public River(Long id, long intervalId, String riverName, String siteName, Long siteId, Date time, double waterLevel,
                 String waterPotential, double flow, Date updateTime, Date createTime) {
        this.id = id;
        this.intervalId = intervalId;
        this.riverName = riverName;
        this.siteName = siteName;
        this.siteId = siteId;
        this.time = time;
        this.waterLevel = waterLevel;
        this.waterPotential = waterPotential;
        this.flow = flow;
        this.updateTime = updateTime;
        this.createTime = createTime;
    }
}
